// TOWN DIALOGUE SCRIPT
//    Town 100: Adobe Hut

begintalkscript;

variables;

short i,j,k,r1,choice;

// Hermit

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Hermit";
	text1 = "You meet a pale, desperately thin man. He has torn, threadbare clothes and a sun-weathered face. He is very upset that you've intruded upon his solitude.";
	text2 = "_Bahhh ... I don't want you here,_ he rasps.";
	text5 = "The monk is still unhappy that you have disturbed his solitude. However, he has neither the strength nor the inclination to force you to leave. He just watches you unhappily.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_Who are you?_";
	text1 = "_It is the end of time. It is the end of the world. My name doesn't matter. Yours doesn't, either._";

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Why do you live up here alone?_";
	text1 = "He sighs. _I came here to contemplate my faith. In solitude._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Tell me about your faith._";
	text1 = "_No, and you're intruding upon my privacy. Good day._ He waves his hand, and you find yourself somewhere else.";
	action = END_TALK;	
	code =
		relocate_char(get_pc_id(0),31,21,FALSE);
		relocate_char(get_pc_id(1),32,21,FALSE);
		relocate_char(get_pc_id(2),32,22,FALSE);
		relocate_char(get_pc_id(3),31,22,FALSE);
	break;


begintalknode;
	state = 1;
	nextstate = 3;
	condition = gf(133,11) >= 1 && gf(100,11) == 0;
	question = "_Nydia mentioned you can perform the ritual of sanctification. Can you teach me how?_";
	text1 = "He looks nervous. _Ah. You want the ritual. An Empire priestess came to me, but she only wanted the ritual in order to sell it. That is not becoming._";
	text2 = "_There is only one reason I do not expel you now._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_What reason is that?_";
	text1 = "He watches you carefully for any sign of your true intentions. _I speak with you because the ritual can be a powerful tool for good, and I feel bound to share it if that is how it will be used._";
	text2 = "_So, tell me. Who do you plan to use the ritual against?_";
	text3 = "_I don't trust you, but I will be generous and give you another chance to convince me. Who do you plan to use the ritual against?_";
	code =
		if (gf(100,12) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Against the corrupting forces of the Empire._";
	text1 = "He shakes his head. _They are of no interest to me._ He waves his hand, and you find yourself somewhere else.";
	action = END_TALK;	
	code =
		sf(100,12,1);
		relocate_char(get_pc_id(0),31,21,FALSE);
		relocate_char(get_pc_id(1),32,21,FALSE);
		relocate_char(get_pc_id(2),32,22,FALSE);
		relocate_char(get_pc_id(3),31,22,FALSE);
	break;

begintalknode;
	state = 4;
	nextstate = 1;
	question = "_Against the slimes._";
	text1 = "He shakes his head. _They are of no interest to me._ He waves his hand, and you find yourself somewhere else.";
	action = END_TALK;	
	code =
		sf(100,12,1);
		relocate_char(get_pc_id(0),31,21,FALSE);
		relocate_char(get_pc_id(1),32,21,FALSE);
		relocate_char(get_pc_id(2),32,22,FALSE);
		relocate_char(get_pc_id(3),31,22,FALSE);
	break;


begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Against the troglodytes._";
	action = END_TALK;
	code =
		run_hardcode(151);
	break;

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Against the cockroaches._";
	text1 = "He shakes his head. _They are of no interest to me._ He waves his hand, and you find yourself somewhere else.";
	action = END_TALK;	
	code =
		sf(100,12,1);
		relocate_char(get_pc_id(0),31,21,FALSE);
		relocate_char(get_pc_id(1),32,21,FALSE);
		relocate_char(get_pc_id(2),32,22,FALSE);
		relocate_char(get_pc_id(3),31,22,FALSE);
	break;

begintalknode;
	state = 1;
	nextstate = 6;
	condition = gf(100,11) >= 1;
	question = "_Thank you for the ritual._";
	text1 = "_I sense that you will use it well. Thus, I had no choice but to give it to you. That is the limit to how much I wish to deal with you. Please leave me._";
	
begintalknode;
	state = 6;
	nextstate = -1;
	condition = 1;
	question = "_I want to know more, though. I want to master it._";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Hermit's Ritual",
		  "The hermit is impressed by your determination. For a donation to fund his life in the mountains, he will teach you more.",
		  92,4,0);	
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_Aren't you afraid of being out here alone?_";
	text1 = "_No. If I am bothered by meddlesome intruders, I do this..._ He waves a hand, and you find yourself elsewhere.";
	action = END_TALK;	
	code =
		relocate_char(get_pc_id(0),31,21,FALSE);
		relocate_char(get_pc_id(1),32,21,FALSE);
		relocate_char(get_pc_id(2),32,22,FALSE);
		relocate_char(get_pc_id(3),31,22,FALSE);
	break;


begintalknode;
	state = 1;
	nextstate = -1;
	question = "_Can I buy any of your goods?_";
	text1 = "_Take what you want. It is of no interest to me. If that is all you care about, I will be going._ He wanders off.";
	action = END_TALK;	

